<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="cus" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="fun" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8"/>
    <c:set var="contextPath" value="${pageContext.request.contextPath}" scope="application"/>
    <link href="http://cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
    <link href="${contextPath}/resources/css/style.default.css" rel="stylesheet">
    <link href="${contextPath}/resources/css/jquery.datatables.css" rel="stylesheet">
    <link href="${contextPath}/resources/css/jquery.gritter.css" rel="stylesheet">

    <script src="${contextPath}/resources/js/jquery-1.11.1.min.js"></script>
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="${contextPath}/resources/js/html5shiv.js"></script>
    <script src="${contextPath}/resources/js/respond.min.js"></script>
    <script type="text/javascript">
        window.location.href = "http://windows.microsoft.com/zh-cn/internet-explorer/ie-11-worldwide-languages";
    </script>
    <![endif]-->
    <script src="${contextPath}/resources/js/jquery-migrate-1.2.1.min.js"></script>
    <script src="${contextPath}/resources/js/jquery-ui-1.10.3.min.js"></script>
    <script src="${contextPath}/resources/js/bootstrap.min.js"></script>
    <script src="${contextPath}/resources/js/modernizr.min.js"></script>
    <script src="${contextPath}/resources/js/jquery.sparkline.min.js"></script>
    <script src="${contextPath}/resources/js/toggles.min.js"></script>
    <script src="${contextPath}/resources/js/retina.min.js"></script>
    <script src="${contextPath}/resources/js/jquery.cookies.js"></script>

    <script src="${contextPath}/resources/js/morris.min.js"></script>
    <script src="${contextPath}/resources/js/raphael-2.1.0.min.js"></script>

    <script src="${contextPath}/resources/js/custom.js"></script>
    <script src="${contextPath}/resources/js/jquery.gritter.min.js"></script>

    <title><decorator:title default=""/></title>
    <script>
        var contextPath = "${contextPath}";
    </script>
    <c:set var="location" value="${pageContext.request.requestURI}"/>
    <decorator:head/>
</head>
<body>
<!-- Preloader -->
<div id="preloader">
    <div id="status"><i class="fa fa-spinner fa-spin"></i></div>
</div>

<section>

    <div class="leftpanel">

        <div class="logopanel">
            <h1 style="font-size: 18px;text-align:center">${name}</h1>
        </div>
        <!-- logopanel -->

        <div class="leftpanelinner">

            <!-- This is only visible to small devices -->
            <div class="visible-xs hidden-sm hidden-md hidden-lg">
                <div class="media userlogged">
                    <img alt="" src="${contextPath}/resources/images/photos/loggeduser.png" class="media-object">

                    <div class="media-body">
                        <h4><shiro:principal/></h4>
                        <%--<span>"Life is so..."</span>--%>
                    </div>
                </div>

                <h5 class="sidebartitle actitle">账户</h5>
                <ul class="nav nav-pills nav-stacked nav-bracket mb30">
                    <li><a href="${contextPath}/admin/user_account/change_self_password.htm"><i class="fa fa-user"></i>
                        <span>修改密码</span></a>
                    </li>
                    <%--<li><a href=""><i class="fa fa-question-circle"></i> <span>Help</span></a></li>--%>
                    <li><a href="${contextPath}/admin/logout.htm"><i class="fa fa-sign-out"></i> <span>退出</span></a>
                    </li>
                </ul>
            </div>

            <h5 class="sidebartitle">菜单</h5>
            <ul class="nav nav-pills nav-stacked nav-bracket">

                <li class="${fun:contains(location, 'admin/index.htm')?"active":""}"><a
                        href="${contextPath}/admin/index.htm"><i
                        class="fa fa-home"></i> <span>首页</span></a>
                </li>
                <shiro:hasPermission name="USER_MANAGER:*">
                    <li class="nav-parent ${fun:contains(location, 'admin/user')?"nav-active active":""}">
                        <a href=""><i class="fa fa-users"></i> <span>用户管理</span></a>
                        <ul class="children">
                            <shiro:hasPermission name="USER_LIST:*">
                                <li class="${fun:contains(location, 'admin/user/list.htm')?"active":""}"><a
                                        href="${contextPath}/admin/user/list.htm"><i class="fa fa-caret-right"></i>用户列表</a>
                                </li>
                            </shiro:hasPermission>
                            <shiro:hasPermission name="USER_ACCOUNT:*">
                                <li class="${fun:contains(location, 'admin/user_account/list.htm')?"active":""}"><a
                                        href="${contextPath}/admin/user_account/list.htm"><i
                                        class="fa fa-caret-right"></i>账号列表</a>
                                </li>
                            </shiro:hasPermission>
                        </ul>
                    </li>
                </shiro:hasPermission>
                <shiro:hasPermission name="WECHAT:*">
                    <li class="nav-parent ${fun:contains(location, 'admin/wechat')?"nav-active active":""}">
                        <a href=""><i class="fa fa-comments"></i> <span>微信管理</span></a>
                        <ul class="children">
                            <shiro:hasPermission name="MEMBER_LIST:*">
                                <li class="${fun:contains(location, 'admin/wechat/member/list.htm')?"active":""}"><a
                                        href="${contextPath}/admin/wechat/member/list.htm"><i
                                        class="fa fa-caret-right"></i>粉丝列表</a>
                                </li>
                            </shiro:hasPermission>
                            <shiro:hasPermission name="REPLY_RULE_LIST:*">
                                <li class="${fun:contains(location, 'admin/wechat/reply_rule_list.htm')?"active":""}">
                                    <a href="${contextPath}/admin/wechat/reply_rule_list.htm">
                                        <i class="fa fa-caret-right"></i>微信回复规则
                                    </a>
                                </li>
                            </shiro:hasPermission>
                            <shiro:hasPermission name="BUTTON_LIST:*">
                                <li class="${fun:contains(location, 'admin/wechat/button_list.htm')?"active":""}">
                                    <a href="${contextPath}/admin/wechat/button_list.htm">
                                        <i class="fa fa-caret-right"></i>自定义菜单</a>
                                </li>
                            </shiro:hasPermission>
                        </ul>
                    </li>
                </shiro:hasPermission>
                <shiro:hasPermission name="ARTICLE_LIST:*">
                    <li class="${fun:contains(location, 'admin/article/list.htm')?"active":""}">
                        <a href="${contextPath}/admin/article/list.htm">
                            <i class="fa fa-book"></i> <span>文章列表</span>
                        </a>
                    </li>
                </shiro:hasPermission>
                <shiro:hasPermission name="IMAGE_LIST:*">
                    <li class="${fun:contains(location, 'admin/image/list.htm')?"active":""}">
                        <a href="${contextPath}/admin/image/list.htm">
                            <i class="fa fa-folder"></i> <span>图片管理</span>
                        </a>
                    </li>
                </shiro:hasPermission>
                <shiro:hasPermission name="REPLY_SET_LIST:*">
                    <li class="${fun:contains(location, 'admin/reply_set/list.htm')?"active":""}">
                        <a href="${contextPath}/admin/reply_set/list.htm">
                            <i class="fa fa-database"></i> <span>常用回复设置</span>
                        </a>
                    </li>
                </shiro:hasPermission>
                <shiro:hasPermission name="ORGANIZATION_MANAGER:*">
                    <li class="nav-parent ${fun:contains(location, 'admin/organization')?"nav-active active":""}">
                        <a href=""><i class="fa fa-sitemap"></i> <span>组织结构管理</span></a>
                        <ul class="children">
                            <shiro:hasPermission name="ORGANIZATION_DEPT_LIST:*">
                                <li class="${fun:contains(location, 'admin/organization/dept/list.htm')?"active":""}"><a
                                        href="${contextPath}/admin/organization/dept/list.htm"><i
                                        class="fa fa-caret-right"></i>部门列表</a>
                                </li>
                            </shiro:hasPermission>
                            <shiro:hasPermission name="ORGANIZATION_ACCOUNT_LIST:*">
                                <li class="${fun:contains(location, 'admin/organization/account/list.htm')?"active":""}">
                                    <a href="${contextPath}/admin/organization/account/list.htm">
                                        <i class="fa fa-caret-right"></i>账号列表</a>
                                </li>
                            </shiro:hasPermission>
                            <shiro:hasPermission name="ORGANIZATION_EMPLOYEE_LIST:*">
                                <li class="${fun:contains(location, 'admin/organization/employee/list.htm')?"active":""}">
                                    <a href="${contextPath}/admin/organization/employee/list.htm">
                                        <i class="fa fa-caret-right"></i>员工列表</a>
                                </li>
                            </shiro:hasPermission>
                        </ul>
                    </li>
                </shiro:hasPermission>
                <shiro:hasPermission name="CMC:*">
                    <li class="nav-parent ${fun:contains(location, 'admin/cmc')?"nav-active active":""}">
                        <a href=""><i class="fa fa-suitcase"></i> <span>案件管理</span></a>
                        <ul class="children">
                            <shiro:hasPermission name="CMC_CATEGORY_LIST:*">
                                <li class="${fun:contains(location, 'admin/cmc/category/list.htm')?"active":""}">
                                    <a href="${contextPath}/admin/cmc/category/list.htm">
                                        <i class="fa fa-caret-right"></i>案件分类</a>
                                </li>
                            </shiro:hasPermission>
                            <shiro:hasPermission name="CMC_CASE_UNFINISHED:*">
                                <li class="${fun:contains(location, 'admin/cmc/case/un_complete_list.htm')?"active":""}">
                                    <a href="${contextPath}/admin/cmc/case/un_complete_list.htm">
                                        <span class="pull-right badge badge-success" id="unComplete">0</span>
                                        <i class="fa fa-caret-right"></i>未完成案件列表</a>
                                </li>
                            </shiro:hasPermission>
                            <shiro:hasPermission name="CMC_CASE_REVIEWED:*">
                                <li class="${fun:contains(location, 'admin/cmc/case/un_pending_list.htm')?"active":""}">
                                    <a href="${contextPath}/admin/cmc/case/un_pending_list.htm">
                                        <span class="pull-right badge badge-success" id="pending">0</span>
                                        <i class="fa fa-caret-right"></i>待审核案件列表</a>
                                </li>
                            </shiro:hasPermission>
                            <shiro:hasPermission name="CMC_CASE_LOCK:*">
                                <li class="${fun:contains(location, 'admin/cmc/case/lock_list.htm')?"active":""}">
                                    <a href="${contextPath}/admin/cmc/case/lock_list.htm">
                                        <span class="pull-right badge badge-success" id="lock">0</span>
                                        <i class="fa fa-caret-right"></i>已锁定案件列表</a>
                                </li>
                            </shiro:hasPermission>
                            <shiro:hasPermission name="CMC_CASE_FINISH:*">
                                <li class="${fun:contains(location, 'admin/cmc/case/complete_list.htm')?"active":""}">
                                    <a href="${contextPath}/admin/cmc/case/complete_list.htm">
                                        <i class="fa fa-caret-right"></i>已完成案件列表</a>
                                </li>
                            </shiro:hasPermission>
                                <%--<shiro:hasPermission name="CMC_CASE_STUBBORN:*">--%>
                                <%--<li class="${fun:contains(location, 'admin/cmc/case/stubborn_list.htm')?"active":""}">--%>
                                <%--<a href="${contextPath}/admin/cmc/case/stubborn_list.htm">--%>
                                <%--<i class="fa fa-caret-right"></i>持续未完成案件</a>--%>
                                <%--</li>--%>
                                <%--</shiro:hasPermission>--%>

                        </ul>
                    </li>
                </shiro:hasPermission>
                <shiro:hasPermission name="REPORT_FORM:*">
                    <li class="nav-parent ${fun:contains(location, 'admin/report')?"nav-active active":""}">
                        <a href=""><i class="fa fa-file-text"></i> <span>报表管理</span></a>
                        <ul class="children">
                            <shiro:hasPermission name="REPORT_FORM_PUSH_GROUP:*">
                                <li class="${fun:contains(location, 'admin/report/push_group/list.htm')?"active":""}">
                                    <a href="${contextPath}/admin/report/push_group/list.htm">
                                        <i class="fa fa-caret-right"></i>推送分组</a>
                                </li>
                            </shiro:hasPermission>
                            <shiro:hasPermission name="REPORT_FORM_REPORT_RULE:*">
                                <li class="${fun:contains(location, 'admin/report/report_rule/list.htm')?"active":""}">
                                    <a href="${contextPath}/admin/report/report_rule/list.htm">
                                        <i class="fa fa-caret-right"></i>报表规则</a>
                                </li>
                            </shiro:hasPermission>
                        </ul>
                    </li>
                </shiro:hasPermission>
                <shiro:hasPermission name="SELF_BINDING:*">
                    <li class="${fun:contains(location, 'admin/self_binding/list.htm')?"active":""}">
                        <a href="${contextPath}/admin/self_binding/list.htm">
                            <i class="fa fa-edit"></i> <span>自助绑定</span>
                        </a>
                    </li>
                </shiro:hasPermission>
                <shiro:hasPermission name="SETTING:*">
                    <li class="${fun:contains(location, 'admin/setting/load.htm')?"active":""}">
                        <a href="${contextPath}/admin/setting/load.htm">
                            <i class="fa fa-cog"></i> <span>系统设置</span>
                        </a>
                    </li>
                </shiro:hasPermission>
            </ul>
        </div>
        <!-- leftpanelinner -->
    </div>
    <!-- leftpanel -->

    <div class="mainpanel">

        <div class="headerbar">

            <a class="menutoggle"><i class="fa fa-bars"></i></a>

            <%--<form class="searchform" action="index.html" method="post">--%>
            <%--<input type="text" class="form-control" name="keyword" placeholder="Search here..."/>--%>
            <%--</form>--%>

            <div class="header-right">
                <ul class="headermenu">
                    <li>
                        <div class="btn-group">
                            <button type="button" class="btn btn-default dropdown-toggle"
                                    data-toggle="dropdown">
                                <img src="${contextPath}/resources/images/photos/loggeduser.png" alt=""/>
                                <shiro:principal/>
                                <%--${sessionScope.get("user").user.name}--%>
                                <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu dropdown-menu-usermenu pull-right">
                                <li><a href="${contextPath}/admin/user_account/change_self_password.htm"><i
                                        class="fa fa-user"></i>
                                    <span>修改密码</span></a></li>
                                <%--<li><a href="#"><i class="glyphicon glyphicon-question-sign"></i> Help</a></li>--%>
                                <li><a href="${contextPath}/admin/logout.htm"><i
                                        class="glyphicon glyphicon-log-out"></i>
                                    退出</a></li>
                            </ul>
                        </div>
                    </li>
                    <li>
                        <%--<button id="chatview" class="btn btn-default tp-icon chat-icon">--%>
                        <%--<i class="glyphicon glyphicon-comment"></i>--%>
                        <%--</button>--%>
                    </li>
                </ul>
            </div>
            <!-- header-right -->

        </div>
        <!-- headerbar -->

        <%--<div class="pageheader">--%>
        <%--<h2><i class="fa fa-home"></i> Dashboard <span>Subtitle goes here...</span></h2>--%>

        <%--<div class="breadcrumb-wrapper">--%>
        <%--<span class="label">You are here:</span>--%>
        <%--<ol class="breadcrumb">--%>
        <%--<li><a href="index.html">Bracket</a></li>--%>
        <%--<li class="active">Dashboard</li>--%>
        <%--</ol>--%>
        <%--</div>--%>
        <%--</div>--%>
        <%--<div class="contentpanel">--%>
        <decorator:body/>
        <%--</div>--%>

    </div>
    <!-- mainpanel -->

    <!-- rightpanel -->
</section>
<script type="text/javascript">
    $(function () {
        getCaseProfile();
        setInterval(getCaseProfile, 10000);
    });
    function getCaseProfile() {
        $.ajax({
            url: '${contextPath}/admin/cmc/case/profile',
            type: 'get',
            cache: false,
            success: function (data) {
                $("#unComplete").html(data.unComplete);
                $("#pending").html(data.pending);
                $("#lock").html(data.lock);
            }
        });
    }
</script>

</body>
</html>